package com.axend.aerosense.dev.fragment;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModel;

import com.axend.aerosense.base.fragment.MvvmBaseFragment;
import com.axend.aerosense.common.base.ITitle;
import com.axend.aerosense.common.util.FragmentUtil;
import com.axend.aerosense.dev.activity.NewDevSetNetActivity;
import com.axend.aerosense.dev.R;
import com.axend.aerosense.dev.databinding.DevFragmentFindHotByUserBinding;

public class DevUserFindHotFragment extends MvvmBaseFragment<DevFragmentFindHotByUserBinding, ViewModel> {

    public static DevUserFindHotFragment getInstance(){
        DevUserFindHotFragment fragment = new DevUserFindHotFragment();
//        Bundle bundle = new Bundle();
//        bundle.putString(ARG_PARAM, str);
//        fragment.setArguments(bundle);   //设置参数
        return fragment;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
//        ((AppCompatActivity) getActivity()).setSupportActionBar(viewDataBinding.devToolbar);
//        int statusBarHeight = getStatusBarHeight();
//        viewDataBinding.devContentParent.setPadding(0,statusBarHeight,0,0);
        initView();
    }

    private void initView() {
        viewDataBinding.devNext.setOnClickListener(v->{
            Fragment fragment = DevAssureSettingFragment.getInstance();

            FragmentUtil.add(getActivity(), ((NewDevSetNetActivity)getActivity()).getContentId(),fragment, this, true);

//            FragmentUtils.hide(this);
//            FragmentUtils.add(getActivity().getSupportFragmentManager(),
//                    fragment,
//                    ((NewDevSetNetActivity)getActivity()).getContentId(),
//                    fragment.getClass().getSimpleName(),
//                    true,
//                    com.axend.aerosense.common.R.anim.common_in_from_left,
//                    com.axend.aerosense.common.R.anim.common_out_to_right,
//                    com.axend.aerosense.common.R.anim.common_in_from_left,
//                    com.axend.aerosense.common.R.anim.common_out_to_right);

        });
    }

    @Override
    public void onResume() {
        super.onResume();
        ((ITitle)getActivity()).setTitle(getString(R.string.dev_connect_new_hot_dev));
    }

    @Override
    public int getLayoutId() {
        return R.layout.dev_fragment_find_hot_by_user;
    }

    @Override
    public int getBindingVariable() {
        return 0;
    }

    @Override
    protected ViewModel getViewModel() {
        return null;
    }

    @Override
    protected void onRetryBtnClick() {

    }
}